import psutil
pc_mem = psutil.virtual_memory()
div = 1024 ** 3
print("total: {:.2f} GB, free: {:.2f} GB".format(pc_mem.total / div, pc_mem.free / div))